package com.bjx.auth.controller;

import com.bjx.auth.domain.param.LoginParam;
import com.bjx.common.captcha.CaptchaContext;
import com.bjx.common.captcha.CaptchaStrategy;
import com.bjx.common.captcha.domain.CaptchaVO;
import com.bjx.common.core.domain.R;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.*;


@RestController
@Tag(name = "LoginController", description = "登录认证接口")
@RequestMapping("/auth/login")
public class LoginController {


    @GetMapping("getCaptcha")
    @Operation(summary = "获取验证码")
    public R<CaptchaVO> getCaptcha(){
        CaptchaStrategy captchaStrategy = CaptchaContext.getCaptchaStrategy();
        return  R.success(captchaStrategy.getCaptcha());
    }


    @PostMapping
    @Operation(summary = "登录")
    public R login(@RequestBody LoginParam loginParam){
        return R.success();
    }

    @PutMapping
    public void k(){

    }
}
